<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>验证码显示</title>
</head>
<body>
<img src="/common/kaptcha"
     onclick="this.src='/common/kaptcha?d='+new Date()"/>
<p>
    <input value="" name="code">
</p>
<input type="button" value="submit">
<script src="plugins/jquery/jquery.min.js"></script>
<script>
    $(function(){
        $("input[type='button']").click(function () {
            var inputV = $('input[name="code"]').val()
            if (!(inputV+'').trim()) {
                alert("验证码不能为空")
            }
            $.ajax({
                url: '/common/verify?code=' + inputV,
                method: 'get',
                success:function (res) {
                    alert(res.message)
                    console.log(res)
                },
                error:function (err) {
                    alert(err.message)
                    console.log(err)
                }
            })
        })
    })
</script>
</body>
</html>